﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Routing;
using System.Web.Mvc;
using System.Web;
using PaymentHelper.Core.CommonUtils;

namespace PaymentHelper.PaymentFlow.ModelTemplate
{
    public class RouteModel
    {
        public string RouteName { get; set; }
        public string Action { get; set; }
        public string Controller { get; set; }
        public RouteValueDictionary RoutePaymentInfo {get;set;}

        public string ToUrl()
        {
            HttpContext httpContext = HttpContext.Current;
            if (httpContext == null)
            {
                return "";
            }

            UrlHelper helper = new UrlHelper(httpContext.Request.RequestContext);

            string url = HttpContext.Current.Request.Url.GetLeftPart(UriPartial.Authority) + helper.Action(Action, Controller, RoutePaymentInfo);

            return url;
        }
    }
}
